
#include "animation.h"

using namespace WtfEngine;

void Animation::Destroy() {
	IDynamic::Destroy(); // Remove from update list

	if(!this->mrOnComplete.isNull()) {
		IFunctor<>::tRef rOnComplete = this->mrOnComplete;
		mrOnComplete.Destroy();
		(*rOnComplete)();
	};
};

Animation* Animation::After(Animation * pAnim) {
	pAnim->mrOnComplete = new ObjFunctor<Animation>(this, &Animation::Init);
	return pAnim;
};

